<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box{
            width: 1000px;
            height: 500px;
            border: solid 3rem rgba(0,0,0,.2);
            background-color: orange;
            padding: 3rem;
            background: url(../../../demo.jpg) no-repeat;
            background-size: auto;
        }
        .length{
            background-size: 200px;
        }
        .percentage{
            background-size: 50%;
        }
        .cover{
            background-size: cover;
            background-origin: padding-box;
            height: 300px;
            width: 500px;
        }
        .contain{
            background-size: contain;
            height: 200px;
        }
    </style>
</head>
<body>
    <h1>background-size</h1>
    <h2>auto</h2>
    <div class="box"></div>

    <h2>length: 200px;</h2>
    <div class="box length"></div>

    <h2>percentage: 50%;</h2>
    <div class="box percentage"></div>

    <h2>cover</h2>
    <div class="box cover"></div>

    <h2>contain</h2>
    <div class="box contain"></div>
</body>
</html>